package com.xiaodu.acer.phoneplay.di.module;

import android.app.ProgressDialog;

import com.xiaodu.acer.phoneplay.data.AppInfoModel;
import com.xiaodu.acer.phoneplay.data.http.ApiService;
import com.xiaodu.acer.phoneplay.presenter.contract.AppInfoContract;
import com.xiaodu.acer.phoneplay.ui.fragment.RecommendFragment;

import dagger.Module;
import dagger.Provides;

/**
 * @author 小杜
 *         邮箱:m15701207383@163.com
 * @version V1.0
 * @Description: ${TODO}(用一句话描述该文件做什么)
 * @date 2018/1/9 14:15
 */
@Module
public class RecommendModule {

    private AppInfoContract.View mView;

    public RecommendModule(AppInfoContract.View view) {
        this.mView = view;
    }

    @Provides
    public AppInfoContract.View provideAppInfoView() {
        return mView;
    }

    @Provides
    public AppInfoModel provideAppInfoModel(ApiService service) {
        return new AppInfoModel(service);
    }

    @Provides
    public ProgressDialog provideProgressBar(AppInfoContract.View view) {
        return new ProgressDialog(((RecommendFragment) view).getActivity());
    }

}
